﻿using System;
using DevExpress.XtraEditors;
using EkStudio.com.bean.xml.WorkFlow.Node;

namespace EkStudio.com.ui.unitbill.WorkFlow
{
    public partial class FlowBENode : XtraUserControl,UiNode
    {

        private WflowModuleNodeItem bean = null;

        public event NodeClickHandle NodeClickEvent = null;
        public FlowBENode(WflowModuleNodeItem it)
        {
            InitializeComponent();
            bean = it;
            Tag = it;
        }

        public WflowModuleNodeItem NodeItem
        {
            get { return bean; }
            set { bean = value; }
        }

        public string NodeCaption
        {
            get
            {
                return bean.Caption;
            }

            set
            {
                labelControl1.Text = value;
            }
        }

        private void labelControl1_Click(object sender, System.EventArgs e)
        {
            if (NodeClickEvent != null)
            {
                NodeClickEvent(this, bean);
            }
        }

        private void FlowBENode_Click(object sender, System.EventArgs e)
        {
            if (NodeClickEvent != null)
            {
                NodeClickEvent(this, bean);
            }
        }
    }
}
